package com.zui.entity.setup;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Index;

import com.zui.entity.BaseAutoIdEntity;
import com.zui.entity.product.Geo;

@Entity
@Table(name="ip")
@org.hibernate.annotations.Table(indexes = { @Index(name="ipIndex", columnNames = { "startIp", "endIp" })}, appliesTo = "ip")
public class Ip extends BaseAutoIdEntity {
	private static final long serialVersionUID = 1L;
	
	private Long startIp;
	private Long endIp;
	private String country;
	private String province;
	private String city;
	private String addr1;
	private Geo geo;

	
	//*********** utility methods *****************************
	@ManyToOne()
	@JoinColumn(name="geoId")
	public Geo getGeo() {	return geo;	}
	@Column(length=16)
	public Long getStartIp() {	return startIp;	}
	@Column(length=16)
	public Long getEndIp() {	return endIp;	}
	@Column(length=50)
	public String getCountry() {	return country;	}
	@Column(length=50)
	public String getProvince() {	return province;	}
	@Column(length=50)
	public String getCity() {	return city;	}
	@Column(length=250)
	public String getAddr1() {	return addr1;	}
	
	
	
	//***************** setters ************************
	
	public void setStartIp(Long startIp) {
		this.startIp = startIp;
	}
	public void setEndIp(Long endIp) {
		this.endIp = endIp;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public void setAddr1(String addr1) {
		this.addr1 = addr1;
	}
	public void setGeo(Geo geo) {
		this.geo = geo;
	}
	
}
